<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <th:block th:include="common.html :: source"></th:block>
  <link href="/static/layui/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="layui-input-block layui-form" id="modifyClass"
     lay-filter="updateClass" style="margin-top: 30px">
  <form class="layui-form" action="" lay-filter="example">
    <!--    ID隐藏-->
    <input type="hidden" class="layui-input" name="orderId" id="orderId" readonly/>

    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">买家</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="buyerName" id="buyerName" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">联系方式</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="buyerPhone" id="buyerPhone" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">地址</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="buyerAddress" id="buyerAddress" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">商品编号</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="shoeId" id="shoeId" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">商品名称</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="shoeName" id="shoeName" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">数量</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="shoeQuantity" id="shoeQuantity" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="shoeIcon" id="shoeIcon" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">规格名称</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="specsId" id="specsId" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">颜色</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="specsNameColor" id="specsNameColor" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">尺码</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="specsNameSize" id="specsNameSize" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">商品价格</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="specsPrice" id="specsPrice" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">总价</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="orderAmount" id="orderAmount" lay-verify="required"/>
        </div>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-inline">
        <label class="layui-form-label">支付状态</label>
        <div class="layui-input-inline">
          <input type="text" class="layui-input" name="payStatus" id="payStatus" lay-verify="required"/>
        </div>
        <label>(1表示已支付)</label>
      </div>
    </div>


    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="enmodify">确认修改</button>
      </div>
    </div>
  </form>
</div>

<script src="/layui/layui.js" charset="UTF-8"></script>
<script type="text/javascript">
  layui.use(['layer', 'form'], function () {
    var layer = layui.layer;
    var form = layui.form;
    form.on('submit()', function () {
      $.post({
        url: '/merchant/updateOrderMaster',
        data: {
          "orderId": $("#orderId").val(),
          "buyerName": $("#buyerName").val(),
          "buyerPhone": $("#buyerPhone").val(),
          "buyerAddress": $("#buyerAddress").val(),
          "shoeId": $("#shoeId").val(),
          "shoeName": $("#shoeName").val(),
          "shoeQuantity": $("#shoeQuantity").val(),
          "shoeIcon": $("#shoeIcon").val(),
          "specsId": $("#specsId").val(),
          "specsNameColor": $("#specsNameColor").val(),
          "specsNameSize": $("#specsNameSize").val(),
          "orderAmount": $("#orderAmount").val(),
          "specsPrice": $("#specsPrice").val(),
          "payStatus": $("#payStatus").val(),
          "createTime": $("#createTime").val(),
          "updateTime": $("#updateTime").val(),
        },
        success: function (data) {
          if (data === "true") {
            layer.msg('修改成功！', {icon: 6, offset: "auto", time: 2000});//提示框
          } else {
            layer.msg('修改失败！', {icon: 5, offset: "auto", time: 2000});//提示框
          }
          setTimeout(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);//关闭弹出层
            parent.location.reload();//重新加载父页面表格
          }, 2100);
        }
      });
      return false;
    });
  });
</script>
</body>
</html>

